package net.aiion.weave;

import net.aiion.weave.spi.messaging.MessageReceiverContext;
import net.aiion.weave.spi.messaging.annotations.Receives;

public class ReceivingClass /*implements Receiver*/
{
    public ReceivingClass() {
    }

    // @Override
    // public void receiveMessage(ReceiverContext aReceiverContext) {
    // if ("no-return-type".equals(aReceiverContext.getQueueName())
    // && Message1.class.isAssignableFrom(aReceiverContext.getMessage().getClass()))
    // {
    // receiveMessage1((Message1) aReceiverContext.getMessage());
    // }
    //
    // if ("with-return-type".equals(aReceiverContext.getQueueName())
    // && Message2.class.isAssignableFrom(aReceiverContext.getMessage().getClass()))
    // {
    // aReceiverContext.setResult(receiveMessage2((Message2) aReceiverContext.getMessage()));
    // }
    //
    // if ("with-context".equals(aReceiverContext.getQueueName())) {
    // receiveMessage3(aReceiverContext);
    // }
    // }

    @Receives("no-return-type")
    public void receiveMessage1(Message1 aMessage) {
    }

    @Receives("with-return-type")
    public Result receiveMessage2(Message2 aMessage) {
        return new Result();
    }

    @Receives("with-context")
    public void receiveMessage3(MessageReceiverContext aReceiverContext) {
    }
}

class Message1
{
}

class Message2
{
}

class Result
{
}
